package com.ruoyi.APPMS.controller;

import com.ruoyi.APPMS.domain.Chart;
import com.ruoyi.APPMS.service.IChartService;
import com.ruoyi.common.core.domain.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/chart/chart")
public class ChartController {
    @Autowired
    private IChartService chartService;

    @GetMapping("/list")
    public List<Chart> list() {
        return chartService.listchart();
    }

    @GetMapping("/customercount")
    public Long customercount() {
        return chartService.customercount();
    }

    @GetMapping("/salespersoncount")
    public Long salespersoncount() {
        return chartService.salespersoncount();
    }

    @GetMapping("/vehiclesaledcount")
    public Long vehiclesaledcount() {
        return chartService.vehiclesaledcount();
    }

    @GetMapping("/partsaledcount")
    public Long partsaledcount() {
        return chartService.partsaledcount();
    }

    @GetMapping("/brandsalecount")
    public List<Chart> brandsalecount() {
        return chartService.brandsalecount();
    }

    @GetMapping("/colorsalecount")
    public List<Chart> colorsalecount() {
        return chartService.colorsalecount();
    }

    @GetMapping("/partsalecount")
    public List<Chart> partsalecount() {
        return chartService.partsalecount();
    }

    @GetMapping("/salepersonachivement")
    public AjaxResult salepersonachivement(){
        return AjaxResult.success(chartService.salepersonachivement());
    }

    @GetMapping("/showpartprofit")
    public AjaxResult showprofit(){
        return AjaxResult.success(chartService.showpartprofit());
    }

    @GetMapping("/showvehicleprofit")
    public AjaxResult showvehicleprofit(){
        return AjaxResult.success(chartService.showvehicleprofit());
    }

}
